A processor in a computer system may receive a request for data at a requested location in memory. The processor may first attempt to access the data in a memory closely associated with the processor, such as a cache, rather than through a typically slower access to main memory. Generally, a cache includes memory that emulates selected regions or blocks of a larger, slower main memory. A cache is typically filled on a demand basis, is physically closer to a processor, and has faster access time than main memory.
If the processor's access to memory “misses” in the cache, e.g., cannot find a copy of the data in the cache, the cache selects a location in the cache to store a copy of the data at the requested location in main memory, issues a request to the main memory for the data at the requested location, and fills the selected cache location with the data from main memory. The cache may also request and store data located spatially near the requested location as programs that request data often make temporally close requests for data from the same or spatially close memory locations, so it may increase efficiency to include spatially near data in the cache. In this way, the processor may access the data in the cache for this request and/or for subsequent requests for data.